import javax.swing.JOptionPane;
import br.com.virtualclassroom.SystemFunctions;

public class InsereValoresBanco {
	public static void main(String[] args) {
		SystemFunctions.printLog(false, "// Starting Program //");
		JOptionPane
				.showMessageDialog(null,
						"SQL Feed me 0.1\nInsert values in MySQL without any knowledge =]");

		int choice = -1;

		do {
			choice = getChoice();
			if (choice != 0) {
				getSelected(choice);
			}
		} while (choice != 0);
		System.exit(0);
	}

	public static int getChoice() {
		String choice;
		int ch;
		choice = JOptionPane.showInputDialog(null, "1. Insert Values\n"
				+ "0. Exit\n\n" + "Enter your choice");

		// Convert String to Int
		ch = Integer.parseInt(choice);
		return ch;

	}

	public static void getSelected(int choice) {
		if (choice == 1) {
			String insertValue = JOptionPane.showInputDialog(null,
					"Enter a Word or a Phrase");
			JDBCFunctions.checkPhrases(insertValue);
		}
	}
}
